home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / editor / volumeabs.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-28  |  2KB  |  83 lines

  1. /* AbsProjectVolume.rexx V3.0 -- Changes the volume of a project globaly  */
  2. /* By Bob Caron (Grue) ©1995 NewTek Inc.                                  */
  3.  
  4. arg frompopup
  5. if frompopup="" then frompopup=0
  6.  
  7. call remlib('PROJECT_REXX_PORT')
  8.  
  9. call addlib('PROJECT_REXX_PORT',0)
  10. call set_view(2)
  11.  
  12. call req_error("Absolute Project Volume V3.0     ---    Change your projects volume to a specific volume.")
  13.  
  14. done=0
  15. do while done=0
  16.   selection=req_tell("Absolute Project Volume V3.0","'Continue' to effect ALL croutons","'Cancel' to effect selected croutons")
  17.   done=1
  18.   if selection=0 & frompopup=0 then do
  19.     if req_tell("Error:","You can only use this feature if you","launch this script from the tools","popup menu.")=0 then call quit()
  20.     done=0
  21.     end
  22. end
  23. if selection=1 then frompopup=0 else frompopup=1
  24.  
  25. project_end=croutonsinproject()
  26. location=1
  27. do count=1 to project_end
  28.   if croutonselectedpos(count)=1 | frompopup=0 then do
  29.      selected.location=count-1
  30.      location=location+1
  31.      end
  32. end
  33.  
  34. location=location-1
  35. current_spot=0
  36. highvol=0
  37. volume=req_number("Change absolute volume to:",70)
  38.  
  39. if volume="CANCEL" then call quit()
  40.  
  41. if volume>100 then volume=100
  42. if volume<0 then volume=0
  43. if volume=highvol then call quit()
  44.  
  45. if req_tell("Are You Sure?")=0 then call quit()
  46.  
  47. volume=(volume*655.35)
  48. current_spot=0
  49.  
  50. call req_open("Working... Please wait.")
  51. chunk=100/location;last=0;dots=0
  52. do count=1 to location
  53.    if crnumtype(selected.count)="CLIP" | crnumtype(selected.count)=" AUD" then do
  54.       call crnumsettag(selected.count,AUDIOVOLUME1,volume)
  55.       call crnumsettag(selected.count,AUDIOVOLUME2,volume)
  56.       end
  57.    last=trunc(dots/10)+1
  58.    dots=dots+chunk;string=copies(".",trunc(dots/10)+1)
  59.    if (last~=trunc(dots/10)+1) then do
  60.       if (11-length(string)>-1) then
  61.          call req_error("[Working"||string||right('           ',11-length(string))||"]")
  62.       end
  63. end
  64.  
  65. call req_close()
  66. call req_error("All done.")
  67. call projectupdate()
  68. call remlib("PROJECT_REXX_PORT")
  69. exit
  70.  
  71. quit:
  72.  
  73. call req_error("Canceled.")
  74. call remlib("PROJECT_REXX_PORT")
  75.  
  76. exit
  77.  
  78. croutonselectedpos:
  79. arg pos
  80. row=trunc(pos/8)
  81. col=pos-(row*8)
  82. row=row+1
  83. return croutonselected(row,col)